import * as types from './actionTypes';
import Immutable from 'seamless-immutable';
const initialState = Immutable({
    dialog:{},
    fetching:{},
    loading:false,
    deviceWidth:414
});
export default function app(state = initialState, action = {}) {
    switch (action.type) {
        case types.SET_DEVICE_WIDTH:
            return state.set("deviceWidth",action.width);
        case types.SET_LOADING:
            return state.set("loading",action.value);
        case types.SET_DIALOG:
            return state.setIn(["dialog",action.key],action.value);
        case types.SET_FETCHING:
            return state.setIn(["fetching",action.key],action.value);
        default:
            return state;
    }
}
